<?php

class JQuerySnippetHolder {
	
	private $snippets;
	
	function __construct() {
		$this->init();
	}
	
	function add_snippet($snippet) {
		if (!isset($this->snippets)) {
			$this->snippets = array();
		}
		
		$this->snippets[] = $snippet;
	}
	
	function get_snippets() {
		$snippetBuffer = $this->snippets;
		
		unset($this->snippets);
		
		$this->init();
		
		return $snippetBuffer;
	}
	
	private function init() {
		$this->add_snippet('error.js');
		$this->add_snippet('info.js');
	}
}

?>